home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CD-ROM Today - The Disc! 5
/
CD-ROM Today - The Disc (Issue 5)(November 1994).ISO
/
mac
/
Mac shareware
/
Education
/
RLaB
/
README.mac
< prev
next >
Wrap
Text File
|
1994-09-21
|
12KB
|
263 lines
06/18/1994
This is the Macintosh port of RLaB 1.0 program. RLaB is a Matlab-like
linear algebra package. The author is
Ian Searle
ians@eskimo.com
RLaB is an interpreter for the RLaB Programming Language/Environment.
The RLaB language is useful for matrix or array oriented numerical
analyses. RLaB is especially useful for prototyping and experimenting
with algorithms. RLaB extensively uses the LAPACK, FFTPACK and RANLIB
sources available from netlib and PLPLOT from hagar.ph.utexas.edu.
MacRLaB is not a full port of RLaB. Some items will probably never
be fully supported as they are too tied to the Unix operating system.
Examples are the 'pipe', the 'fork', the 'socket', and many others.
Other features are handled a little differently in the Mac version.
Most of the important differences or extensions of the MacRLaB port
are described below.
1. Please print out and study the RLaB Primer first, the file is in
":doc:rlabp.ps". You can print this Postscript file using 'ShowPages'
program (simply drag and drop it into ShowPages , assume that
you have a Postscript printer connected, of course).
If you cannot access to a Postscript printer, you can run TeX on
rlabp.tex to generate rlabp.dvi, then run a DVI conversion program
to generate a printable file for your printer.
The full history command editing capacity is built-in. To recall
previous commands, just press up and down arrow keys.
The 'control' key described in the RLaB Primer can be replaced by the
'command' key on the Mac keyboard. Delete-cursor-character (del) is also
supported. The full description of command line editing is in file
":help:COMMAND_EDIT", or type "help COMMAND_EDIT" in RLaB.
If you need other handy keys, I would like to hear about that.
2. In this version, you can set up your own file search-path(RLAB_SEARCH_PATH),
start-up file (RLAB_RC0), etc.. The default settings are stored in the file
'RLab-Preference'.
To change the settings, just use a text editor to change. You have to
set the PLPLOT_DIR environmental variable to the path of your RLaB folder.
This setting is important because PLPLOT has to know the location of font
files 'plstnd5.fnt' and 'plxtnd5.fnt'. After making the changes, the file
'RLab-Preference' has to be placed in the 'System Folder:Preferences' folder.
For example, if your absolute RLaB folder (directory) path is like
HD --- Appl --- RLaB
then you can put the following environmental variables in 'RLab-Preference':
RLAB_RC0 = ".rlab";
PLPLOT_DIR = "HD:Appl:RLaB";
RLAB_HELP_DIR = "HD:Appl:RLaB:help";
RLAB_LIB_DIR = "HD:Appl:RLaB:rlib";
RLAB_SEARCH_PATH = "HD:Appl:RLaB:toolbox;HD:Appl:RLaB:examples";
You can have several search-paths, just put them together and use ';' as
delimiter (see above example with 2 search paths).
Since RLaB uses absolute search path, the the maximum length of each path
is 31 characters in length, don't place RLaB folder too deep in your hard
disk directory tree. Also, don't drag MacRLaB out of RLaB folder, use alias.
If you feel the font/size in the MacRLaB console is not the best choice,
feel free to change it. The environmental variable RLAB_FONT can be set
to one of the following numbers (check Mac document for more):
0 SystemFont
1 AppleFont
2 NewYork
3 Geneva
4 Monaco
5 Venice
6 London
7 Athens
8 SanFrancisco
9 Toronto
11 Cairo
12 LosAngles
20 Times
21 Helvetica
22 Courier
It is better to use constant width fonts such as Monaco and Courier,
otherwise the output will not be aligned.
The font size (RLAB_SIZE) can be set to any number from 1 to 127 points.
The popular font sizes for the console are
9 points
10 points
11 points
12 points
14 points
18 points
You can change the number of rows (RLAB_ROWS) on the console also.
Default values are
RLAB_FONT = "4 Monaco";
RLAB_SIZE = "9 points";
RLAB_ROWS = "25";
If you put RLaB folder in a RAM-disk, you have to rename .rlab to another
name without '.' as its first character, then put the new name in RLAB_RC0
environmental variable. MacRLaB will hang if it reads .rlab from a
RAM-disk. You tell me why.
3. This version of RLaB comes with a built-in plotting library PLPLOT.
PLPLOT is a powerful tool for XY and XYZ graphics. It can generate
(via plprint) Postscript, color Postscript, HP LJ, and lots of other
formats for post processing.
I've implemented a minimum Mac interface for PLPLOT. Multi-window is
allowed but the redrawing is slow. The number of windows is limited
to 10. You can resize graphics windows in this version.
Because RLaB keeps scanning the command line and providing line
editing service, if you wish to watch background graphics windows, you must
enter pause mode before you can click any background graphics window.
You can enter pause mode by calling function
pause();
or type
ESC--P
in RLaB interactive environment (ESC--P means: press ESC, release ESC,
press P, release P). ESC--P is equivalent to ESC--` (on mac extended
keyboards, the ESC key is near to the ` key, see).
The interface is based on ColorQuickDraw routines. Sixteen colors are
directly available in PLPLOT. These colors are pre-assigned as the
following numbers:
0 1 2 3 4 5 6 7
coral red yellow green aquamarine pink wheat gray
8 9 10 11 12 13 14 15
brown blue blueviolet cyan turquoise magenta salmon black
You can select color by _plcol() function. More colors are available by
using RGB combinations (see PLPLOT manual). There are three things remained
to be done -- add scroll bar to the MacRLaB window, add copy/paste ability
in the graphics windows, and add PICT image to the generated EPS files.
At this stage, you can include the Postscript output (EPSF) in your document
(Word, MacDraw, Canvas, TeX, ...) but you can only see a big crossed
box (the bounding box) on the screen due to the lack of PICT image.
You can perform scaling, rotating, dragging,... on the box except there
is no picture inside. The picture will appear in the printed copy.
If you need superscript, subscript, over/under line char, and Greek letters
in annotation of axis, title, etc., then you need to get a copy of PLPLOT
manual. See README.PLPLOT for detail. Here is an example which uses
Greek letters and superscript,
>load(":examples:fun_plot.r");
or
>rfile fun_plot
Another plotting example is in ":examples:plot_test.r", try
>rfile plot_test
You can click on those background windows to see them again. The graphics
windows are numbered as plplot 0, plplot 1, plplot 2, ..., and so on. You
can also resize or drag them. Resizing on the screen will not affect
the quality of later plprint() output. Also, don't use pend() to close
graphics windows unless you don't want to plot anymore. Use pclose()
instead.
For each graph window, there is a temporary file (SCRATCH ????)
associated with it. It contains your plotting commands which can be used
later to produce a Postscript or other types of graphics files (via
plprint). It is also used by my Mac interface in redrawing. Don't dump
them to trash during the execution of MacRLaB. They will be automatically
eliminated after execution.
4. By the way, do you know how to change directory (folder) using cd() on the
Mac? Here is how.
Suppose that your hard disk directory tree is like this
----- Peggy
| |-- rlib
--------- App -----| |
| | |-- examples
HD ---| ----- RLaB (you are here) ----|
| |-- help
-------- Kevin |
|-- toolbox
When you launch RLaB, you are in RLaB directory. If you wish to
change directory to "examples", you can use either
>cd(":examples"); // relative method ( cannot use cd("examples"); )
or
>cd("HD:App:RLaB:examples"); // absolute method
The colon ":" means present directory, it is similar to "." on the Unix
but not exactly the same. You MUST supply a ":" at first if partial
(relative) pathname is used. If the first character of a pathname is not
a ":", it is a full (absolute) pathname. Two colons "::" means parent
directory (folder). Three colons ":::" means grandparent directory.
For example, if your work directory is in Kevin and you are in
RLaB now, you can use either
>cd(":::Kevin"); // relative method
or
>cd("HD:Kevin"); // absolute method
to change directory to Kevin.
5. Your machine must have a MC68020/30/40 and a numerical processor
(MC68881 or better) to run RLaB (sorry!). You don't need a numerical
processor on a MC68040 based machine. You also need System 7 to run it.
RLaB is a 32-bit clean program. Try
>load("test")
on your machine to see if your machine can pass all tests.
6. The total size of arrays is only limited by the available memory of your
machine. If RLaB runs out of memory, it will display
RLaB: out of memory.
on the screen. You can either increase RLaB memory using 'Get Info' of
System 7 Finder or, if your physical RAM is limited, turn on the virtual
memory and set memory size large enough for your application.
7. To interrupt RLaB during execution, type command-. (i.e. press command
key + period key), it will return to the interactive mode in the next i/o.
To abort RLaB and kick it out, you can use File-Quit (command-Q) on Menu bar.
You can also do so by type in command-d at the beginning of a command line.
If RLaB hangs, type command-option-esc to abort it.
8. Since RLaB interprets your .r code line-by-line, don't forget to press
'return' at the end of the last line of your .r file. If you forget to
do so, a syntax error will be issued. It's hard to debug such error.
9. If you wish to join the RLaB community, send an email to Ian and ask him
to add your name in the mailing list. You can reach the RLaB community by
sending email to rlab-list@eskimo.com .
10. We need more toolboxes. Please send your useful .r files to Ian. Thanks.
11. THIS IS FREE SOFTWARE. THERE IS NO WARRANTY FOR THE PROGRAM. USE IT AT
YOUR OWN RISK.
Have fun!
Tzong-Shuoh Yang
(tsyang@ce.berkeley.edu)